﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LogSystem
{
    public class LogSubject
    {
        private readonly List<ILogObserver> _observers = new List<ILogObserver>();

        public void AddObserver(ILogObserver observer)
        {
            _observers.Add(observer);
        }

        public void RemoveObserver(ILogObserver observer)
        {
            _observers.Remove(observer);
        }

        public void NotifyObservers(string message)
        {
            foreach (var observer in _observers)
            {
                observer.Update(message);
            }
        }
    }
}
